package com.zhuoge.demo;

public class ExceptionDemo2 {
    public static void main(String[] args) {
        int age = 17;
        try {
            // throw new MyException();
            if (age < 18){
                throw new MyException("nntx");
            }
        }catch (Exception a){
            System.out.println("zdl");
        }
    }
}
class MyException extends Exception{
    public MyException() {
    }

    public MyException(String message) {
        super(message);
    }
}